# coding:utf-8

class Person(object):
    name = None
    age = None
    eat = None

    def __init__(self, name: str, age: int = 36):
        """
        构造函数
        :param name: 姓名
        :param age: 年龄
        """
        self.name = name
        self.age = age
        self.make_money = lambda money: money if isinstance(money, int) else (
            money if isinstance(money, float) else None)
        self.eat = lambda money, food: print(f'{self.name}拿着{money}元RMB, 去买{food}给媳妇吃')

    def sleep(self, func):
        def tmp(*args, **kwargs):
            func(*args, **kwargs)

        return tmp

    def aa(self):
        print('aa')

    def swim(self):
        print(f'{self.name} like swimming!')
        # return f'{self.name} like swimming!'


zhang_san = Person('张三')
# zhang_san.name = '张三'
# zhang_san.age = 25

zhang_san.eat(zhang_san.make_money(25), '红糖糍粑')
zhang_san.sleep(zhang_san.swim)()

print("--------------")


def a(func):
    def b(*args, **kwargs):
        return func(*args, **kwargs)

    return b


def c(name):
    print(name)


a(c('dewei'))

print('==========================')

def d(func):
    def b(*args, **kwargs):
        return func(*args, **kwargs)
    return b

@d
def e(name):
    print(name)


e('le_ku_yuan')